<?php
/**
 * User: Mark Johnson
 * Date: Sep 28, 2010
 * Time: 6:48:11 PM
 * 
 * All requests are redirected here using the configurations in the .htaccess file.
 * 
 * Redirecting all requests to this file allows the system to properly load necessary
 * configuration data, system variables, database connections and functions, 
 * rendering functions, form creation functions, etc. 
 * 
 * The only page request that does not get redirected here is to install.php because if the
 * system has not been installed yet, it cannot load. 
 * 
 */

define('RUN_TESTS', FALSE);
//define('RUN_TESTS', TRUE);

define('ROOT', dirname(__FILE__));
define('DS', DIRECTORY_SEPARATOR);

define('DEBUG', TRUE);

if (defined('DEBUG') && DEBUG === TRUE)
{
	include_once ('./krumo/class.krumo.php');
}

$argv = array();

$argv['q'] = (isset($_GET['q']) ? $_GET['q'] : NULL);

/**
 * main()
 * 
 * This function builds the "system" that supports all page rendering and form creation in the entire site 
 * 
 * @param string $q the URI as shown in a web browser
 * 
 * @return
 * 		an array of variables consisting that are useful for the rest of the functions in the system
 */
function main(int $argc = 0, array $argv = array())
{
	// the initialization functions of the system
	require_once('./includes/bootstrap.inc');
	bootstrap($argv, $argv);
}

main(count($argv), $argv);


// This function call "loads" the desired content 
// $load is the a setup function for the file that contains the desired content 

// call_user_func_array($router->load);


// prints the output for the page

// print(render('page'));



